﻿<%@ Page Title="注册" Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs"
    Inherits="WaterApp.Account.Register" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>用户管理</title>
    <link href="../Styles/if.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">   
    <asp:ScriptManager ID="ScriptManage1" runat="server"></asp:ScriptManager>
    <script type="text/javascript">
        function mustinput() {
            var usermc = $get("<%=UserName.ClientID %>").value;
            var userPass = $get("<%=Password.ClientID %>").value;
            var confirmPass = $get("<%=ConfirmPassword.ClientID %>").value;
            var tbemail = $get("<%=Email.ClientID %>").value;        
            if ((usermc == "") || (userPass == "") || (confirmPass == "") || (tbemail == "")) {
                alert("有内容没有输入，请检查没有输入的地方，并输入！");
                return false;
            }
            if (userPass != confirmPass) {
                alert("密码与确认密码不一致,请重新输入！");
                $get("<%=ConfirmPassword.ClientID %>").focus();
                return false;
            }
        }
    
        function CheckPassWord(pwstr) {
            //密码由数字、大写英文、小写英文和特殊字符组成。特殊字符包括（#,@,&,*）
            var regu = /^(?=.*?[a-z])(?=.*?[A-Z])(?=.*?\d)(?=.*?[#@*&.]).*$/;
            var re = new RegExp(regu);
            if (re.test(pwstr)) {
                return true;
            }
            else {
                return false;
            }
        }      
    </script>   
    <div style="width:100%; background-color: #E0E0E0; height:30px; 
                font-family:宋体; font-size:12px; font-weight:bold; line-height:30px;">
      系统管理=>用户管理
    </div>               
    <br />
    <br />
    <br />
    <div style="width:100%;">
                <asp:DataGrid ID="UserGrid" runat="server" Width="100%" AutoGenerateColumns="false"
                             PagerStyle-Mode="NumericPages" AllowPaging="true" PageSize="20"
                             Font-Size="13px"
                             OnPageIndexChanged ="UserGrid_PageIndexChanged">
                <HeaderStyle CssClass="poputopbj" Font-Names="Arial,宋体" Font-Size="12px" Font-Bold="true" />  
                <SelectedItemStyle BackColor = "#CCCCCC" ForeColor="black" />  
                <AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>    
                <PagerStyle ForeColor="Black" />
                <Columns>
                  <asp:BoundColumn DataField="IsOnline" HeaderText="在线"></asp:BoundColumn>
                  <asp:BoundColumn DataField="LastPasswordChangedDate" HeaderText="最近更改密码时间" Visible="false"></asp:BoundColumn>
                  <asp:BoundColumn DataField="PasswordQuestion" HeaderText="口令问题" ItemStyle-HorizontalAlign="Left"></asp:BoundColumn>
                  <asp:BoundColumn DataField="UserName" HeaderText="用户名称" ItemStyle-HorizontalAlign="Left"></asp:BoundColumn>
                  <asp:BoundColumn DataField="Email" HeaderText="电子邮件" ItemStyle-HorizontalAlign="Left"></asp:BoundColumn>
                  <asp:BoundColumn DataField="CreationDate" HeaderText="创建时间" ItemStyle-HorizontalAlign="Left" Visible="false"></asp:BoundColumn>
                  <asp:BoundColumn DataField="LastLoginDate" HeaderText="最近登录时间" ItemStyle-HorizontalAlign="Left"></asp:BoundColumn>
                  <asp:BoundColumn DataField="IsLockedOut" HeaderText="是否锁定" ItemStyle-HorizontalAlign="Left"></asp:BoundColumn>
                  <asp:TemplateColumn ItemStyle-Width="30px">
                     <ItemTemplate>
                          <asp:LinkButton ID="linkSel" runat="server" 
                                          CommandName="Select" Text="选择" ForeColor="Black"></asp:LinkButton>
                     </ItemTemplate>
                  </asp:TemplateColumn>          
                </Columns>
               </asp:DataGrid>
               <div style="width:99%; text-align:right;">                                    
                    <asp:LinkButton ID="lnkunlock" runat="server" Width="80px" CssClass="linkbutton" 
                                    Text="解锁" OnClick = "lnkunlock_Click"></asp:LinkButton>         
                    <asp:LinkButton ID="lnkDeluser" runat="server" Width="80px" CssClass="linkbutton" 
                                    OnClientClick="return confirm('确定要删除当前选择的用户吗?')" Text="删除用户"
                                     OnClick = "lnkDeluser_Click"></asp:LinkButton> 
                    <asp:LinkButton ID="lnkAddUser" runat="server" OnClientClick="return false" 
                                    Width="80px" CssClass="linkbutton" 
                                    Text = "添加用户"></asp:LinkButton>
                                                                          
            </div>
            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lnkAddUser"
                   PopupControlID="popupan" CancelControlID="lnkClose" X="100" Y="85" /> 
            <asp:Panel ID="popupan" runat="server" Style="display: none; width: 80%; height: 350px;
                   text-align: center; background-color: White; border: 1px solid Gray;"> 
                    <div style="text-align: right; width:99%; height:30px; margin:3px;background-image:url(../Images/picture/shengse_01.gif);background-position:top;background-repeat:repeat-x;">
                       <asp:LinkButton ID="lnkClose" runat="server" Text="X" ToolTip="Close" Height="20px" Width="15px" 
                                       Style="background-color: #666666; color: #FFFFFF; text-align: center; 
                                              font-weight: bold; text-decoration: none;
                                              border: outset thin #FFFFFF; margin:3px;" />
                    </div>                             
                <div>
        <table style="width: 500px;">
            <tr>
                <td style="font-family: 宋体; font-size: 13px; text-align: right;">
                    <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">用户名:</asp:Label>
                </td>
                <td style="text-align:left;">
                    <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox>
                    <asp:label ID="Label2" runat="server" ForeColor="Red">*</asp:label> 
                </td>
            </tr>
            <tr>
                <td style="font-family: 宋体; font-size: 13px; text-align: right;">
                    <asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">电子邮件:</asp:Label>
                </td>
                <td style="text-align:left;">
                    <asp:TextBox ID="Email" runat="server" CssClass="textEntry"></asp:TextBox>
                     <asp:label ID="Label1" runat="server" ForeColor="Red">*</asp:label>                    
                </td>
            </tr>
            <tr>
                <td style="font-family: 宋体; font-size: 13px; text-align: right;">
                    <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码:</asp:Label>
                </td>
                <td style="text-align:left;">
                    <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                    <asp:label ID="passwordlb" runat="server" ForeColor="Red">* 密码的长度至少必须为6</asp:label>
                   </td>
            </tr>
            <tr>
                <td style="font-family: 宋体; font-size: 13px; text-align: right;">
                    <asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">确认密码:</asp:Label>
                </td>
                <td style="text-align:left;">
                    <asp:TextBox ID="ConfirmPassword" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox>
                    <asp:label ID="Label3" runat="server" ForeColor="Red">*</asp:label> 
                 </td>
            </tr>
            <tr>
                <td colspan="2" style="font-family: 宋体; font-size: 13px; text-align: right;">
                    <asp:LinkButton ID="lnkSaveUser" runat="server" Width="80px" CssClass="linkbutton"  
                                    Text="创建用户" OnClientClick="return mustinput()"
                                    OnClick = "lnkSaveUser_Click"></asp:LinkButton>
                </td>
            </tr>
        </table>
        </div>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
